package com.lwhtarena.netty.netty4.server;

import com.lwhtarena.netty.netty4.code.NettyMessageDecoder;
import com.lwhtarena.netty.netty4.code.NettyMessageEncoder;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.FixedLengthFrameDecoder;
import io.netty.handler.codec.serialization.ClassResolvers;
import io.netty.handler.codec.serialization.ObjectDecoder;
import io.netty.handler.codec.serialization.ObjectEncoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.CharsetUtil;

/**
 * @author： liwh
 * @Date: 2016/11/17.
 * @Description：
 */
public class FileChannelInitializer extends ChannelInitializer<Channel> {
    @Override
    protected void initChannel(Channel ch) throws Exception {

       // ch.pipeline().addLast(new StringEncoder(CharsetUtil.US_ASCII));
       // ch.pipeline().addLast(new FixedLengthFrameDecoder(30));
        ch.pipeline().addLast(new SampleFileHandler());

//        ch.pipeline().addLast(new WaitFileDecoder());
//        ch.pipeline().addLast(new SampleFileAdapterHandler());
    }
}
